bitkeeper revision 1.1159.1.145 (4140e840rdAgNzGs4H22eopT-ononA)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 9 Sep 2004 23:33:20 +0000 (23:33 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 9 Sep 2004 23:33:20 +0000 (23:33 +0000)
Fix Xen for recent GCC.

xen/include/acpi/platform/acgcc.h
xen/include/xen/compiler.h
xen/include/xen/init.h

index 61abbc378cd0608fc5c591d8659e2025faddd1ec..ac15b084606e427afca26c858f6821b6241383a1 100644 (file)
@@ -54,6 +54,6 @@
  * to to tell the compiler warning in a per-variable manner that a variable
  * is unused.
  */
-#define ACPI_UNUSED_VAR __attribute__ ((unused))
+#define ACPI_UNUSED_VAR __attribute_used__
 
 #endif /* __ACGCC_H__ */
index 05205c74bc4c60b686d2b271540151626a9c3e6f..f0c5fbf17ab743f9357a4bf2b1da01509bb059b0 100644 (file)
 #define likely(x)      __builtin_expect((x),1)
 #define unlikely(x)    __builtin_expect((x),0)
 
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+#define __attribute_used__ __attribute__((__used__))
+#else
+#define __attribute_used__ __attribute__((__unused__))
+#endif
+
 #endif /* __LINUX_COMPILER_H */
index 4b0589befd8798266089ee530bbb6aadfed51d32..7e66567a5b81fd1d6fb02ac78da4f4793c2e38e4 100644 (file)
@@ -67,7 +67,7 @@ extern struct kernel_param __setup_start, __setup_end;
 
 #define __setup(str, fn)                                                               \
        static char __setup_str_##fn[] __initdata = str;                                \
-       static struct kernel_param __setup_##fn __attribute__((unused)) __initsetup = { __setup_str_##fn, fn }
+       static struct kernel_param __setup_##fn __attribute_used__ __initsetup = { __setup_str_##fn, fn }
 
 #endif /* __ASSEMBLY__ */
 
@@ -76,12 +76,12 @@ extern struct kernel_param __setup_start, __setup_end;
  * or exit time.
  */
 #define __init         __attribute__ ((__section__ (".text.init")))
-#define __exit         __attribute__ ((unused, __section__(".text.exit")))
+#define __exit         __attribute_used__ __attribute__ ((__section__(".text.exit")))
 #define __initdata     __attribute__ ((__section__ (".data.init")))
-#define __exitdata     __attribute__ ((unused, __section__ (".data.exit")))
-#define __initsetup    __attribute__ ((unused,__section__ (".setup.init")))
-#define __init_call    __attribute__ ((unused,__section__ (".initcall.init")))
-#define __exit_call    __attribute__ ((unused,__section__ (".exitcall.exit")))
+#define __exitdata     __attribute_used__ __attribute__ ((__section__ (".data.exit")))
+#define __initsetup    __attribute_used__ __attribute__ ((__section__ (".setup.init")))
+#define __init_call    __attribute_used__ __attribute__ ((__section__ (".initcall.init")))
+#define __exit_call    __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
 
 /* For assembly routines */
 #define __INIT         .section        ".text.init","ax"